package com.djhu.msg.annotation;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by zw on 2018/3/16.
 */
public class Invocation {
    private Method method;

    private Object target;

    private Object[] params;

    public Invocation(Method method, Object target, Object[] params) {
        this.method = method;
        this.target = target;
        this.params = params;
    }

    public Object Invoke() throws InvocationTargetException, IllegalAccessException {
        return method.invoke(target,params);
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public void setTarget(Object target) {
        this.target = target;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }

    //    public Method getMethod() {
//        return method;
//    }
//
//    public void setMethod(Method method) {
//        this.method = method;
//    }
//
//    public Object getTarget() {
//        return target;
//    }
//
//    public void setTarget(Object target) {
//        this.target = target;
//    }
//
//    public Object[] getParams() {
//        return params;
//    }
//
//    public void setParams(Object[] params) {
//        this.params = params;
//    }
}